// var MongoClient = require('mongodb').MongoClient;
const dbConfig = require("./config.js").database;
const anthor = dbConfig.user + ":" + dbConfig.passwd + "@";
const url = 'mongodb://' + anthor + dbConfig.ip + ':' + dbConfig.port + '/' + dbConfig.dbname;
const dbName = dbConfig.dbname;


// const mongoose = require('mongoose');
// mongoose.connect(url, { useNewUrlParser:true });
// const Cat = mongoose.model('student', { name: String });
// const kitty = new Cat({ name: 'Zildjian2' });
// kitty.save().then(() => console.log('meow'));

console.log(url);
console.log('mongodb://' + dbConfig.ip + ':' + dbConfig.port + '/' + dbConfig.dbname);
module.exports = url;